import store from "@/store";
import { numberFormat } from "@/util/util.js";
export const tableOption = {
  arrow: false,
  column: [
    {
      type: "input",
      label: "唯一标识",
      prop: "id",
      hide: true
    },
    {
      type: "input",
      label: "主表关联ID",
      prop: "relationId",
      hide: true
    },
    {
      type: "select",
      label: "TVM编号",
      prop: "tvmCode",
      filterable: true,
      cell: true,
      dicUrl: "/support/swpmtvmcode/page",
      props: {
        label: "tvmCode",
        value: "tvmCode",
        res: "data.records"
      },
      dicQuery: {
        size: -1,
        stationCode: store.getters.userInfo.stationCode,
        status: "1"
      }
    },
    {
      type: "input",
      label: "钱箱类型",
      prop: "tvmType",
      hide: true
    },
    // {
    //   type: "select",
    //   label: "钱箱编号",
    //   prop: "cashboxCode",
    //   filterable: true,
    //   allowCreate: true,
    //   cell: true,
    //   dicUrl:
    //     "/support/swpmtvmcashboxcode/page?size=-1&stationCode=" +
    //     store.getters.userInfo.stationCode,
    //   props: {
    //     label: "cashboxCode",
    //     value: "cashboxCode",
    //     res: "data.records"
    //   },
    //   hide: true
    // },
    {
      type: "number",
      label: "显示金额",
      prop: "sysAmount",
      precision: 2,
      cell: true,
      value: "0",
      hide: true
    },
    {
      type: "number",
      label: "实点金额",
      prop: "realAmount",
      precision: 2,
      cell: true,
      value: "0",
      slot: true,
      formatter: (row, value, label, column) => {
        return numberFormat(value, column.precision);
      }
    },
    {
      type: "number",
      label: "非标准币金额",
      prop: "nsAmount",
      precision: 2,
      cell: true,
      value: "0",
      slot: true,
      formatter: (row, value, label, column) => {
        return numberFormat(value, column.precision);
      }
    },
    {
      type: "number",
      label: "差异金额",
      prop: "diffAmount",
      precision: 2,
      value: "0",
      hide: true,
      formatter: (row, value, label, column) => {
        return numberFormat(value, column.precision);
      }
    },
    {
      type: "input",
      label: "未卸载状态 0已卸载 1钱箱故障 2:设备故障3:其他",
      prop: "unloadStatus",
      hide: true
    },
    {
      type: "select",
      label: "未卸载原因",
      prop: "unloadCase",
      dicUrl: "/admin/dict/type/sw_st_tvm_check_detail_uninstall_reason",
      cell: true
    },
    {
      type: "input",
      label: "创建时间",
      prop: "createTime",
      hide: true
    },
    {
      type: "input",
      label: "数据更新时间",
      prop: "updateTime",
      hide: true
    },
    {
      type: "input",
      label: "删除标志 1：删除 0：未删",
      prop: "delFlag",
      hide: true
    }
  ]
};

export const tableOptionEdit = {
  arrow: false,
  column: [
    {
      type: "input",
      label: "唯一标识",
      prop: "id",
      hide: true
    },
    {
      type: "input",
      label: "主表关联ID",
      prop: "relationId",
      hide: true
    },
    {
      type: "select",
      label: "TVM编号",
      prop: "tvmCode",
      dicUrl: "/support/swpmtvmcode/page",
      props: {
        label: "tvmCode",
        value: "tvmCode",
        res: "data.records"
      },
      dicQuery: {
        size: -1,
        stationCode: store.getters.userInfo.stationCode,
        status: "1"
      }
    },
    {
      type: "input",
      label: "钱箱类型",
      prop: "tvmType",
      hide: true
    },
    // {
    //   type: "select",
    //   label: "钱箱编号",
    //   prop: "cashboxCode",
    //   filterable: true,
    //   allowCreate: true,
    //   cell: true,
    //   dicUrl:
    //     "/support/swpmtvmcashboxcode/page?size=-1&stationCode=" +
    //     store.getters.userInfo.stationCode,
    //   props: {
    //     label: "cashboxCode",
    //     value: "cashboxCode",
    //     res: "data.records"
    //   },
    //   hide: true
    // },
    {
      type: "number",
      label: "显示金额",
      prop: "sysAmount",
      precision: 2,
      cell: true,
      value: "0",
      hide: true
    },
    {
      type: "number",
      label: "实点金额",
      prop: "realAmount",
      precision: 2,
      cell: true,
      value: "0",
      slot: true,
      formatter: (row, value, label, column) => {
        return numberFormat(value, column.precision);
      }
    },
    {
      type: "number",
      label: "非标准币金额",
      prop: "nsAmount",
      precision: 2,
      cell: true,
      value: "0",
      slot: true,
      formatter: (row, value, label, column) => {
        return numberFormat(value, column.precision);
      }
    },
    {
      type: "number",
      label: "差异金额",
      prop: "diffAmount",
      precision: 2,
      value: "0",
      hide: true,
      formatter: (row, value, label, column) => {
        return numberFormat(value, column.precision);
      }
    },
    {
      type: "input",
      label: "未卸载状态 0已卸载 1钱箱故障 2:设备故障3:其他",
      prop: "unloadStatus",
      hide: true
    },
    {
      type: "select",
      label: "未卸载原因",
      prop: "unloadCase",
      dicUrl: "/admin/dict/type/sw_st_tvm_check_detail_uninstall_reason",
      cell: true
    },
    {
      type: "input",
      label: "创建时间",
      prop: "createTime",
      hide: true
    },
    {
      type: "input",
      label: "数据更新时间",
      prop: "updateTime",
      hide: true
    },
    {
      type: "input",
      label: "删除标志 1：删除 0：未删",
      prop: "delFlag",
      hide: true
    }
  ]
};

export const tableOptionView = {
  detail: true,
  menu: false,
  header: false,
  arrow: false,
  column: [
    {
      type: "input",
      label: "唯一标识",
      prop: "id",
      hide: true
    },
    {
      type: "input",
      label: "主表关联ID",
      prop: "relationId",
      hide: true
    },
    {
      type: "select",
      label: "TVM编号",
      prop: "tvmCode",
      cell: true,
      dicUrl: "/support/swpmtvmcode/page",
      props: {
        label: "tvmCode",
        value: "tvmCode",
        res: "data.records"
      },
      dicQuery: {
        size: -1,
        stationCode: store.getters.userInfo.stationCode,
        status: "1"
      }
    },
    {
      type: "select",
      label: "钱箱类型",
      prop: "tvmType",
      hide: true,
      dicUrl: "/admin/dict/type/sw_st_input_cashbox_uninstalled_type"
    },
    // {
    //   type: "select",
    //   label: "钱箱编号",
    //   prop: "cashboxCode",
    //   filterable: true,
    //   allowCreate: true,
    //   cell: true,
    //   dicUrl:
    //     "/support/swpmtvmcashboxcode/page?size=-1&stationCode=" +
    //     store.getters.userInfo.stationCode,
    //   props: {
    //     label: "cashboxCode",
    //     value: "cashboxCode",
    //     res: "data.records"
    //   },
    //   hide: true
    // },
    {
      type: "number",
      label: "显示金额",
      prop: "sysAmount",
      precision: 2,
      cell: true,
      value: "0",
      hide: true
    },
    {
      type: "number",
      label: "实点金额",
      prop: "realAmount",
      precision: 2,
      cell: true,
      value: "0",
      formatter: (row, value, label, column) => {
        return numberFormat(value, column.precision);
      }
    },
    {
      type: "number",
      label: "非标准币金额",
      prop: "nsAmount",
      precision: 2,
      cell: true,
      value: "0",
      formatter: (row, value, label, column) => {
        return numberFormat(value, column.precision);
      }
    },
    {
      type: "number",
      label: "差异金额",
      prop: "diffAmount",
      precision: 2,
      cell: true,
      value: "0",
      hide: true
    },
    {
      type: "input",
      label: "未卸载状态 0已卸载 1钱箱故障 2:设备故障3:其他",
      prop: "unloadStatus",
      hide: true
    },
    {
      type: "select",
      label: "未卸载原因",
      prop: "unloadCase",
      dicUrl: "/admin/dict/type/sw_st_tvm_check_detail_uninstall_reason",
      cell: true
    },
    {
      type: "input",
      label: "创建时间",
      prop: "createTime",
      hide: true
    },
    {
      type: "input",
      label: "数据更新时间",
      prop: "updateTime",
      hide: true
    },
    {
      type: "input",
      label: "删除标志 1：删除 0：未删",
      prop: "delFlag",
      hide: true
    }
  ]
};

export const tableOptionRecords = {
  detail: true,
  menu: false,
  header: false,
  arrow: false,
  column: [
    {
      type: "input",
      label: "唯一标识",
      prop: "id",
      hide: true
    },
    {
      type: "input",
      label: "主表关联ID",
      prop: "relationId",
      hide: true
    },
    {
      type: "select",
      label: "TVM编号",
      prop: "tvmCode",
      cell: true,
      dicUrl: "/support/swpmtvmcode/page",
      props: {
        label: "tvmCode",
        value: "tvmCode",
        res: "data.records"
      },
      dicQuery: {
        size: -1,
        stationCode: store.getters.userInfo.stationCode,
        status: "1"
      }
    },
    {
      type: "select",
      label: "钱箱类型",
      prop: "tvmType",
      hide: true,
      dicUrl: "/admin/dict/type/sw_st_input_cashbox_uninstalled_type"
    },
    // {
    //   type: "select",
    //   label: "钱箱编号",
    //   prop: "cashboxCode",
    //   filterable: true,
    //   allowCreate: true,
    //   cell: true,
    //   dicUrl:
    //     "/support/swpmtvmcashboxcode/page?size=-1&stationCode=" +
    //     store.getters.userInfo.stationCode,
    //   props: {
    //     label: "cashboxCode",
    //     value: "cashboxCode",
    //     res: "data.records"
    //   },
    //   hide: true
    // },
    {
      type: "number",
      label: "显示金额",
      prop: "sysAmount",
      precision: 2,
      cell: true,
      value: "0",
      hide: true
    },
    {
      type: "number",
      label: "实点金额",
      prop: "realAmount",
      precision: 2,
      cell: true,
      value: "0",
      formatter: (row, value, label, column) => {
        return numberFormat(value, column.precision);
      }
    },
    {
      type: "number",
      label: "非标准币金额",
      prop: "nsAmount",
      precision: 2,
      cell: true,
      value: "0",
      formatter: (row, value, label, column) => {
        return numberFormat(value, column.precision);
      }
    },
    {
      type: "number",
      label: "差异金额",
      prop: "diffAmount",
      precision: 2,
      cell: true,
      value: "0",
      hide: true
    },
    {
      type: "input",
      label: "未卸载状态 0已卸载 1钱箱故障 2:设备故障3:其他",
      prop: "unloadStatus",
      hide: true
    },
    {
      type: "select",
      label: "未卸载原因",
      prop: "unloadCase",
      dicUrl: "/admin/dict/type/sw_st_tvm_check_detail_uninstall_reason",
      cell: true
    },
    {
      type: "input",
      label: "创建时间",
      prop: "createTime",
      hide: true
    },
    {
      type: "input",
      label: "数据更新时间",
      prop: "updateTime",
      hide: true
    },
    {
      type: "input",
      label: "删除标志 1：删除 0：未删",
      prop: "delFlag",
      hide: true
    }
  ]
};
